package com.chixing.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RabbitConfig {

    @Bean
    public Queue helloQueue() {
        return new Queue("hello",true);
    }
    @Bean
    DirectExchange HelloExchange(){
        return new DirectExchange("HelloExchange");
    }
    @Bean
    Binding bindingDirect(){
        return BindingBuilder.bind(helloQueue()).to(HelloExchange()).with("HelloRouting");
    }



}